/**
 * Copyright © 2013 Creativor Studio.
 * About license information, please see LICENSE.txt.
 */
package org.creativor.rayson.client.transport.http;

import java.io.IOException;

import org.creativor.rayson.share.annotation.NotNull;
import org.creativor.rayson.share.transport.http.HttpRequest;

/**
 * An socket connection for HTTP protocol.
 * 
 * @author creativor
 */
public interface HttpConnection {
	/**
	 * Close this connection. That will return it back to the pool.
	 * 
	 * @throws IOException
	 *             If any IO error.
	 */
	public void close() throws IOException;

	/**
	 * Send a request to invoking an RPC.
	 * 
	 * @param request
	 *            HTTP requst.
	 * @throws InterruptedException
	 * @throws If
	 *             IO error.
	 */
	public void send(@NotNull HttpRequest request) throws IOException,
			InterruptedException;
}